package com.amap.api.col.s;

import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import java.lang.ref.WeakReference;

/* compiled from: OfflineLocManager.java */
/* loaded from: classes.dex */
public class ee {
    static int a = 1000;
    static boolean b = false;
    static int c = 20;
    static int d = 0;
    private static WeakReference<eb> e = null;
    private static int f = 10;

    /* compiled from: OfflineLocManager.java */
    /* loaded from: classes.dex */
    public static class a extends ey {
        private int a = 2;
        private Context b;
        private ed c;

        a(Context context) {
            this.b = context;
        }

        @Override // com.amap.api.col.s.ey
        public final void a() {
            int i = this.a;
            if (i == 1) {
                try {
                    synchronized (ee.class) {
                        String l = Long.toString(System.currentTimeMillis());
                        eb a = eh.a(ee.e);
                        eh.a(this.b, a, dd.i, ee.a, 2097152, "6");
                        if (a.e == null) {
                            a.e = new dl(new dn(new Cdo(new dn())));
                        }
                        ec.a(l, this.c.a(), a);
                    }
                } catch (Throwable th) {
                    df.c(th, "ofm", "aple");
                }
            } else if (i == 2) {
                try {
                    eb a2 = eh.a(ee.e);
                    eh.a(this.b, a2, dd.i, ee.a, 2097152, "6");
                    a2.h = 14400000;
                    if (a2.g == null) {
                        a2.g = new el(new ek(this.b, new ep(), new dl(new dn(new Cdo())), new String(cr.a()), bw.f(this.b), ca.k(), ca.h(), ca.f(this.b), ca.a(), Build.MANUFACTURER, Build.DEVICE, ca.m(), bw.c(this.b), Build.MODEL, bw.d(this.b), bw.b(this.b), ca.e(this.b), ca.a(this.b), String.valueOf(Build.VERSION.SDK_INT), cn.a(this.b).a()));
                    }
                    if (TextUtils.isEmpty(a2.i)) {
                        a2.i = "fKey";
                    }
                    a2.f = new et(this.b, a2.h, a2.i, new er(this.b, ee.b, ee.f * 1024, ee.c * 1024, "offLocKey", ee.d * 1024));
                    ec.a(a2);
                } catch (Throwable th2) {
                    df.c(th2, "ofm", "uold");
                }
            }
        }
    }

    public static void a(Context context) {
        ex.a().b(new a(context));
    }
}
